use std::rc::Rc;

#[test]
fn test_smart_pointer() {
    let n = Rc::new(45);
    let pwd = "23231";
    println!("{}", is_strong(pwd));
}

// 可以接收String 和 &str
fn is_strong<T: AsRef<str>>(password: T) -> bool {
    password.as_ref().len() > 5
}

#[test]
fn test_endian() {
    let big_endian: [u8; 4] = [0xAA, 0xBB, 0xCC, 0xDD];
    let little_endian: [u8; 4] = [0xDD, 0xCC, 0xBB, 0xAA];
    let a: i32 = unsafe { std::mem::transmute(big_endian) };
    let b: i32 = unsafe { std::mem::transmute(little_endian) };

    println!("{:032b}={}={:x} vs {:032b}={}={:X}", a, a, a, b, b, b);
}